﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SME.Food.Surperise.BLL;
using SME.Food.Surperise.Model;

namespace SME.Food.Tricon.Web.AdminJS.MenusManage
{
    public partial class MenusPay : System.Web.UI.Page
    {
        public Bas_Menus_Model MenusModel = new Bas_Menus_Model();
        public Bas_Menus_BLL Menusbll = new Bas_Menus_BLL();
        public Menus_Dishes_BLL MenuDishesbll = new Menus_Dishes_BLL();
        public Bas_Dishes_BLL bll = new Bas_Dishes_BLL();
        public Bas_Member_BLL membll = new Bas_Member_BLL();
        public string Menus_No = "", Mem_Name = "", Menu_Time = "", Num = "", Money = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            show();
        }

        public void show()
        {
           Menus_No = Request.QueryString["Menus_No"];
           MenusModel = Menusbll.GetModel(Menus_No);
           Mem_Name =membll.GetModel(MenusModel.Mem_No).Mem_Name;
           Num = MenusModel.TotalNum.ToString() ;
           Menu_Time = MenusModel.Menus_Time.ToString();
           Money = MenusModel.TotalMony.ToString() + "元";
           DataTable table = MenuDishesbll.GetList(" Menus_No in (" + Menus_No + ")").Tables[0];
            StringBuilder sb = new StringBuilder();
            if (table.Rows.Count > 0)
            {
                foreach (DataRow dr in table.Rows)
                {
                    sb.AppendFormat("<tr>");
                    sb.AppendFormat("<td>{0}</td>", bll.GetModel(dr["Dishes_No"].ToString()).Dishes_Name);
                    sb.AppendFormat("<td>{0}</td>", dr["Dishes_Price"]);
                    sb.AppendFormat("<td>{0}</td>", dr["Num"]);
                    sb.AppendFormat("</tr>");
                }
                MenusLitreal.Text = sb.ToString();
            }
        }
    }
}